package demo4;

import demo3.SingletonLazy00;

//测试多线程环境下懒汉模式
public class TestSingletonLazy01Mul {
    public static void main(String[] args) {
        Thread[] threads=new Thread[10];
        for (int i = 0; i <threads.length ; i++) {
            threads[i]=new Thread(()->{
                SingletonLazy01 singletonLazy01=SingletonLazy01.getInstance();
                System.out.println(singletonLazy01);
            });
        }
        for (Thread t:threads
             ) {
            t.start();
        }
    }
    //有问题
}
